<template>
  <div class="search-nav">
    <el-form :inline="true"
             :model="formInline"
             class="form-inline">
      <el-form-item label="机构名称:"
                    class="inputDeep">
        <el-input class="innerInput"
                  v-model="formInline.name"
                  placeholder="--请输入--"
                  size="large"
                  input-style />
      </el-form-item>
      <el-form-item class="btns">
        <el-button type="primary"
                   @click="onSubmit">查询</el-button>
        <el-button type="success"
                   @click="onClear">清空</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { reactive, ref, defineEmits } from 'vue'
const formInline = reactive({
  name: ''
})
const emits = defineEmits(['onSearch'])
const onSubmit = () => {
  emits('onSearch', formInline)
}
const onClear = () => {
  formInline.name = ''
  emits('onSearch', formInline)
}
</script>

<style lang="scss" scoped>
.form-inline {
  width: 100%;
  position: relative;
  :deep(.inputDeep .el-input__inner) {
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.39);
    width: 260px;
    height: 36px;
  }
}
</style>
